<!-- 一期所有样式和js都写入到html中 -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="X-UA-Compatible" content="IE=edge" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover"
    />
    <title>逗学教育</title>
    <link rel="stylesheet" href="../../common/css/vant.css" />
    <link rel="stylesheet" href="../../common/css/common.css" />
    <!-- 引入chapter组件样式 -->
    <link rel="stylesheet" href="../../widget/components/wrong/index.css" />
    <style>
      /*
			页面的所有css，必须有页面前缀
			如首页，则所有css以 .index- 开头
     */
      .page-content {
        background-color: #fff;
      }
      .customerService-title-container {
        width: 100%;
        height: 4.3rem;
        padding-top: 1.26rem;
        background-image: url('./image/customerService/bg.png');
      }
      .customerService-title {
        position: relative;
        width: 5.48rem;
        height: 1.36rem;
        line-height: 0.39rem;
        margin: 0 0 0 0.83rem;
        padding: 0.27rem 0.3rem;
        font-size: 0.26rem;
        color: rgba(222, 42, 32, 1);
        background-color: #fff;
      }
      .customerService-title::after {
        content: '';
        position: absolute;
        right: -0.06rem;
        bottom: 0;
        width: 1rem;
        border: 0.1rem solid transparent;
        border-bottom: 0.1rem solid #fff;
      }
      .customerService-icon {
        position: absolute;
        right: -0.6rem;
        bottom: -0.3rem;
        width: 0.5rem;
        height: 0.5rem;
        background-image: url('./image/customerService/kefu.png');
      }
      .customerService-code {
        width: 2.88rem;
        height: 2.88rem;
        line-height: 2.88rem;
        text-align: center;
        margin: 1.51rem auto 0 auto;
      }
      .customerService-info {
        margin-top: 0.3rem;
        font-size: 0.26rem;
        text-align: center;
        color: rgba(51, 51, 51, 1);
      }
      .qr-code {
        width: 100%;
        height: 100%;
        border-radius: 0.2rem;
      }
    </style>
  </head>
  <body>
    <div id="app" v-cloak>
      <!-- *********************** 头 *******************************-->
      <div class="page-top">
        <div class="page-top">
          <div class="flex-wrap flex-justify-between flex-center-wrap header">
            <div class="header-row" @click="goBack">
              <img
                class="header-row-img"
                src="../../common/image/back.png"
                alt=""
              />
            </div>
            <div class="flex header-title">联系客服</div>
            <div class="header-right">
              <!-- 此处需换成 icon -->
              <div></div>
            </div>
          </div>
        </div>
      </div>
      <!--************************** 内容 *************************-->
      <div class="page-content">
        <div class="placeholder"></div>
        <!-- loading页面 -->
        <div v-if="isShowZLLoading" class="zl-loading">
          <img
            class="zl-loading-img"
            src="../../common/image/white.png"
            alt=""
          />
        </div>
        <div class="bg-full customerService-title-container">
          <div class="customerService-title">
            <div class="text-ess-2">{{ serviceData.title }}</div>
            <div class="bg-full customerService-icon"></div>
          </div>
        </div>
        <div class="customerService-code">
          <img class="qr-code" :src="serviceData.path" alt="错误" />
        </div>
        <p class="customerService-info">长按识别二维码，联系老师</p>
      </div>
    </div>

    <script src="../../common/js/common.js"></script>
    <script src="../../common/js/vue.min.js"></script>
    <script src="../../common/js/vant.min.js"></script>
    <script src="../../common/js/http.js"></script>
    <script src="../../widget/service/user.service.js"></script>
    <script src="../../common/js/utils.js"></script>
    <!-- 引入wrong组件 -->
    <script src="../../widget/components/wrong/index.js"></script>
    <script>
      // 注册 Lazyload 组件
      Vue.use(vant.Lazyload)

      new Vue({
        el: '#app',
        components: {
          'zl-wrong': wrong
        },
        data: {
          serviceData: {},
          isShowZLLoading: true
        },
        computed: {},
        methods: {
          goBack() {
            window.history.back(-1)
          }
        },
        created() {
          const queryObj = utils.getQuery(location.href)
          userService
            .getServiceQRCode({ cateid: queryObj.cateid })
            .then(res => {
              this.serviceData = res
              this.isShowZLLoading = false
            })
        }
      })
    </script>
  </body>
</html>
